<?php
header("content-type:text/html;charset=utf-8");
require("config.php");												//包含数据库连接文件
$id=$_GET["id"];
$select="SELECT * FROM article where id='$id'";
$result=mysql_query($select);
$row = mysql_fetch_assoc($result);
?>

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>修改文章</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="http://cdn.bootcss.com/twitter-bootstrap/3.0.3/css/bootstrap.min.css">
    <script src="http://cdn.bootcss.com/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
	</head>
  <body>
	<div class="page-header" align="center">
		<h1>修改文章</h1>
	</div>
	<div class="container">
		<div class="jumbotron">
		<form class="form-horizontal" action="update.php?id=<?php echo $id?>" method="post" >
		    <div class="form-group">
				<label for="title" class="col-sm-2">标题</label>
				<div class="col-sm-10">
					<input type="text" class="form-control"  id="title" placeholder="标题" name="title" value="<?php echo $row['title']?>">
				</div>
			</div>
			<div class="form-group">
				<label for="content" class="col-sm-2">内容</label>
				<textarea class="form-control" rows="20" id="content" name="content"><?php echo $row['content']?></textarea>
			</div>
			<div class="form-group">
				<div class="col-sm-10">
					<input type="submit" id="submit" name="submit" class="btn btn-success" value="提交">
				</div>
			</div>
			</div>
		</div>
	</div>
  </body>
</html>

